﻿using System.Collections.Generic;
using SpCop.Core.Model;
using SpCop.Model;

namespace SpCop.General.Receivers
{
    public class SiteOrWebFeatureReceiversShouldNotAccessUpperScopes : RuleBase
    {
       
        public override IList<Problem> Check(Package package)
        {

            base.Check(package);
            VisitCollection(package.Features, Visit);
            return Problems;


        }
        public override void Visit(Feature item)
        {
            //   if(!string.IsNullOrEmpty(item.ReceiverTypeName))
            //   {
            //       // _problems.Add(new Problem(GetResolution("ReceiverNotFound",item.ReceiverTypeName, item.Title)));

               
            //       try
            //       {
            //           var typeNode = GetReceiverTypeNode(item);

            //           using (new MethodTimer("WebApplication > "))
            //           {
                        
            //           WebApplicationVisitor visitor = new WebApplicationVisitor();
            //           visitor.VisitTypeNode(typeNode);
                    
            //           }
                       

            //           AddProblem("IsAbusingScopeLevel",item.Title,item.Scope.ToString());

            //       }catch(Exception ex )
            //       {
            //       }
            //   }

        }
    }
}